Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove scrollbars from filters #1015

Merged
merged 3 commits into from
Dec 3, 2021
Merged

Conversation

nmanu1
Copy link
Contributor

@nmanu1 nmanu1 commented Dec 2, 2021

Change styling of yxt-FilterOptions-options to remove scrollbars that were appearing on filters even when all options were displayed for some cases with custom font sizes. Add a --yxt-filters-and-sorts-line-height variable so that customers can change the line-height of the optionLabel easily if the scrollbar appears with even larger custom font sizes.

J=SLAP-1727
TEST=visual

See that filter scrollbar was removed on a site where it was previously appearing.

@coveralls
Copy link

coveralls commented Dec 2, 2021

Coverage Status

Coverage remained the same at 8.844% when pulling ba40a1e on dev/remove-filter-scrollbars into 2b71bfd on develop.

Copy link
Collaborator

@tmeyer2115 tmeyer2115 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also verify that a site without this issue still looks/works as expected? Rose said not all sites seemed to suffer from this problem. I think it would also be good to verify Rose's suspicion that font size and margin are the culprit here. Were you able to verify that?

@@ -23,8 +23,9 @@
}

&-options {
margin-top: 4px;
margin-bottom: 4px;
margin: 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the margin: 0 necessary here? Do the options inherit margin from somewhere up the CSS chain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's inheriting margin from the SDK styling for yxt-FilterOptions-options

@nmanu1
Copy link
Contributor Author

nmanu1 commented Dec 2, 2021

The underlying problem is that if a custom font-size is specified for yxt-FilterOptions-optionLabel, but the line-height is left as is, then a large custom font-size can make the text height larger than the line height, causing the scrollbar to appear.

Edit: After talking with Rose, I added a variable so that the line height can be changed easily from the same place the font size is customized.

@tmeyer2115
Copy link
Collaborator

The underlying problem is that if a custom font-size is specified for yxt-FilterOptions-optionLabel, but the line-height is left as is, then a large custom font-size can make the text height larger than the line height, causing the scrollbar to appear.

Edit: After talking with Rose, I added a variable so that the line height can be changed easily from the same place the font size is customized.

Given this, do we still need to remove the margin and replace it with padding in sdk-filter-overrides.scss? If the problem is really the relationship between font size and line height, I think customers experiencing this issue should use the new variable to update their line height. Us making the CSS changes in the overrides file almost masks the real issue from them.

@nmanu1
Copy link
Contributor Author

nmanu1 commented Dec 3, 2021

Given this, do we still need to remove the margin and replace it with padding in sdk-filter-overrides.scss? If the problem is really the relationship between font size and line height, I think customers experiencing this issue should use the new variable to update their line height. Us making the CSS changes in the overrides file almost masks the real issue from them.

I asked Rose if we should just add the variable, but she was in favor of also modifying the padding/margin to give customers a little more lee-way before the scrollbar appears.

@nmanu1 nmanu1 merged commit f1fad30 into develop Dec 3, 2021
@nmanu1 nmanu1 deleted the dev/remove-filter-scrollbars branch December 3, 2021 14:00
@tmeyer2115 tmeyer2115 mentioned this pull request Dec 14, 2021
tmeyer2115 added a commit that referenced this pull request Dec 14, 2021
### Features
- Consumer Authentication support was added for the Sandbox environment. (#996)
- The existing `image` formatter was updated to support photos sent from the Streams API. (#998)
- Support for Direct Answers on Vertical was added to the `vertical-standard` template. It is commented out by default. (#994)

### Changes
- To better support Consumer Authentication, the `AnswersExperience.init()` method can be called on `Document` load. (#995)
- The default `universalLimit` for all Vertical page configs was updated to 4. (#1010, #1021)

### Bugfixes
- Ensured that in all page templates, the `SpellCheck` appears above the `ResultsCount`. (#1011, #1017)
- In the `highlightedField` formatter, any HTML tag that appears in the text, that is not `<mark>` or `</mark>`, is now escaped. (#1012)
- Font pre-loads on Multi-lang sites now work correctly. (#1018)
- A new CSS variable was added: `--yxt-filter-options-option-label-line-height`. This variable, when kept in proper proportion to `--yxt-filters-and-sorts-font-size`, will ensure the scroll bar does not erroneously appear for filter options. (#1015, #1019)
@tmeyer2115 tmeyer2115 mentioned this pull request Jan 11, 2022
tmeyer2115 added a commit that referenced this pull request Jan 11, 2022
### Features
- Consumer Authentication support was added for the Sandbox environment. (#996)
- The existing `image` formatter was updated to support photos sent from the Streams API. (#998)
- Support for Direct Answers on Vertical was added to the `vertical-standard` template. It is commented out by default. (#994)

### Changes
- To better support Consumer Authentication, the `AnswersExperience.init()` method can be called on `Document` load. (#995)
- The default `universalLimit` for all Vertical page configs was updated to 4. (#1010, #1021)

### Bugfixes
- Ensured that in all page templates, the `SpellCheck` appears above the `ResultsCount`. (#1011, #1017)
- In the `highlightedField` formatter, any HTML tag that appears in the text, that is not `<mark>` or `</mark>`, is now escaped. (#1012)
- Font pre-loads on Multi-lang sites now work correctly. (#1018)
- A new CSS variable was added: `--yxt-filter-options-option-label-line-height`. This variable, when kept in proper proportion to `--yxt-filters-and-sorts-font-size`, will ensure the scroll bar does not erroneously appear for filter options. (#1015, #1019)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants